#!/usr/bin/python3
# -*- coding:utf-8 -*-
#python version: 3.6.7

def checkcode18(in_code):
    in_code = str(in_code)
    if len(in_code) != 17:
        return 'error'
    s = 0
    for i in range(17):
        if i % 2 == 0:
            s += int(in_code[i]) * 3
        else:
            s += int(in_code[i])
    s = s * 9 % 10
    return s

